import apiUrl from '@/apis/urls/baseApi'

/**
 * https://pro.antdv.com/docs/authority-management
 * 
 * {
 *    hidden:false     控制路由是否显示在 sidebar
 *    redirect: ''     重定向地址,
 *    name:''          路由名称, 必须设置,且不能重名
 *    hideChildrenInMenu: false  是否隐藏子菜单
 *    meta: {
 *         title: '',                               路由标题
 *         icon: '',                                路由在 menu 上显示的图标
 *         keepAlive: false,                        缓存该路由 默认为 true
 *         target: '_blank|_self|_top|_parent',     菜单链接跳转目标
 *         hiddenHeaderContent: false ,             隐藏 PageHeader 组件中的页面带的 面包屑和页面标题栏
 *         hideInMultiTab: false                    隐藏在 MultiTab 中
 * 
 *    }
 *  
 * } 
 * 
 */

export default {
    url: apiUrl.systemMenu,
    response: [
        //dashboard
        {
            path: '/dashboard',
            name: 'dashboard',
            redirect: '/dashboard/workplace',
            title: 'menu.dashboard',
            icon: 'dashboard',
            children: [
                {
                    path: '/dashboard/analysis',
                    name: 'Analysis',
                    component: '/dashboard/Analysis',
                    title: 'menu.dashboard.analysis',
                    keepAlive: false,
                },
                // 外部链接
                {
                    path: 'https://www.baidu.com/',
                    name: 'Monitor',
                    title: 'menu.dashboard.monitor',
                    target: '_blank'
                },
                {
                    path: '/dashboard/workplace',
                    name: 'Workplace',
                    component: '/dashboard/Workplace',
                    title: 'menu.dashboard.workplace',
                }
            ]
        },

        // forms
        {
            path: '/form',
            redirect: '/form/base-form',
            title: 'menu.form',
            icon: 'form',
            children: [
                {
                    path: '/form/base-form',
                    name: 'BaseForm',
                    component: '/form/BasicForm',
                    title: 'menu.form.basic-form',
                },
                {
                    path: '/form/step-form',
                    name: 'StepForm',
                    component: '/form/stepForm/StepForm',
                    title: 'menu.form.step-form',
                },
                {
                    path: '/form/advanced-form',
                    name: 'AdvanceForm',
                    component: '/form/advancedForm/AdvancedForm',
                    title: 'menu.form.advanced-form',
                }
            ]
        },

        // list
        {
            path: '/list',
            name: 'list',
            redirect: '/list/table-list',
            title: 'menu.list',
            icon: 'table',
            children: [
                {
                    path: '/list/table-list/:pageNo([1-9]\\d*)?',
                    name: 'TableListWrapper',
                    hideChildren: true, // 强制显示 MenuItem 而不是 SubMenu
                    component: '/list/TableList',
                    title: 'menu.list.table-list',
                },
                {
                    path: '/list/basic-list',
                    name: 'BasicList',
                    component: '/list/BasicList',
                    title: 'menu.list.basic-list',
                },
                {
                    path: '/list/card',
                    name: 'CardList',
                    component: '/list/CardList',
                    title: 'menu.list.card-list',
                },
                {
                    path: '/list/search',
                    name: 'SearchList',
                    component: '/list/search/SearchLayout',
                    redirect: '/list/search/article',
                    title: 'menu.list.search-list',
                    children: [
                        {
                            path: '/list/search/article',
                            name: 'SearchArticles',
                            component: '/list/search/Article',
                            title: 'menu.list.search-list.articles',
                        },
                        {
                            path: '/list/search/project',
                            name: 'SearchProjects',
                            component: '/list/search/Projects',
                            title: 'menu.list.search-list.projects',
                        },
                        {
                            path: '/list/search/application',
                            name: 'SearchApplications',
                            component: '/list/search/Applications',
                            title: 'menu.list.search-list.applications',
                        }
                    ]
                }
            ]
        },

        // profile
        {
            path: '/profile',
            name: 'profile',
            redirect: '/profile/basic',
            title: 'menu.profile',
            icon: 'profile',
            children: [
                {
                    path: '/profile/basic',
                    name: 'ProfileBasic',
                    component: '/profile/Basic',
                    title: 'menu.profile.basic',
                },
                {
                    path: '/profile/advanced',
                    name: 'ProfileAdvanced',
                    component: '/profile/Advanced',
                    title: 'menu.profile.advanced',
                    hiddenHeaderContent: true,
                }
            ]
        },

        // result
        {
            path: '/result',
            name: 'result',
            redirect: '/result/success',
            title: 'menu.result',
            icon: 'check-circle-o',
            children: [
                {
                    path: '/result/success',
                    name: 'ResultSuccess',
                    component: '/result/Success',
                    title: 'menu.result.success',
                    keepAlive: false,
                    hiddenHeaderContent: true,
                },
                {
                    path: '/result/fail',
                    name: 'ResultFail',
                    component: '/result/Error',
                    title: 'menu.result.fail',
                    keepAlive: false,
                    hiddenHeaderContent: true,
                }
            ]
        },

        // Exception
        {
            path: '/exception',
            name: 'exception',
            redirect: '/exception/403',
            title: 'menu.exception',
            icon: 'warning',
            children: [
                {
                    path: '/exception/403',
                    name: 'Exception403',
                    component: '/exception/403',
                    title: 'menu.exception.not-permission',
                },
                {
                    path: '/exception/404',
                    name: 'Exception404',
                    component: '/exception/404',
                    title: 'menu.exception.not-find',
                },
                {
                    path: '/exception/500',
                    name: 'Exception500',
                    component: '/exception/500',
                    title: 'menu.exception.server-error',
                }
            ]
        },

        // account
        {
            path: '/account',
            redirect: '/account/center',
            name: 'account',
            title: 'menu.account',
            icon: 'user',
            children: [
                {
                    path: '/account/center',
                    name: 'center',
                    component: '/account/center',
                    title: 'menu.account.center',
                },
                {
                    path: '/account/settings',
                    name: 'settings',
                    component: '/account/settings/Index',
                    title: 'menu.account.settings',
                    hideHeader: true,
                    redirect: '/account/settings/basic',
                    hideChildren: true,
                    children: [
                        {
                            path: '/account/settings/basic',
                            name: 'BasicSettings',
                            component: '/account/settings/BasicSetting',
                            title: 'account.settings.menuMap.basic',
                            hidden: true,
                        },
                        {
                            path: '/account/settings/security',
                            name: 'SecuritySettings',
                            component: '/account/settings/Security',
                            title: 'account.settings.menuMap.security',
                            hidden: true,
                            meta: { hideInMultiTab: true }
                        },
                        {
                            path: '/account/settings/custom',
                            name: 'CustomSettings',
                            component: '/account/settings/Custom',
                            title: 'account.settings.menuMap.custom',
                            hidden: true,
                            meta: { hideInMultiTab: true }
                        },
                        {
                            path: '/account/settings/binding',
                            name: 'BindingSettings',
                            component: '/account/settings/Binding',
                            title: 'account.settings.menuMap.binding',
                            hidden: true,
                            meta: { hideInMultiTab: true }
                        },
                        {
                            path: '/account/settings/notification',
                            name: 'NotificationSettings',
                            component: '/account/settings/Notification',
                            title: 'account.settings.menuMap.notification',
                            hidden: true,
                            meta: { hideInMultiTab: true }
                        }
                    ]
                }
            ]
        },

        // other
        {
            path: '/other',
            name: 'otherPage',
            component: 'PageView',
            title: '其他组件',
            icon: 'slack',
            redirect: '/other/icon-selector',
            children: [
                {
                    path: '/other/icon-selector',
                    name: 'TestIconSelect',
                    component: '/other/IconSelectorView',
                    title: 'IconSelector',
                    icon: 'tool',
                },
                {
                    path: '/other/list',
                    title: '业务布局',
                    icon: 'layout',
                    redirect: '/other/list/tree-list',
                    children: [
                        {
                            path: '/other/list/tree-list',
                            name: 'TreeList',
                            component: '/other/TreeList',
                            title: '树目录表格',
                        },
                        {
                            path: '/other/list/edit-table',
                            name: 'EditList',
                            component: '/other/TableInnerEditList',
                            title: '内联编辑表格',
                        },
                        {
                            path: '/other/list/user-list',
                            name: 'UserList',
                            component: '/other/UserList',
                            title: '用户列表',
                        },
                        {
                            path: '/other/list/role-list',
                            name: 'RoleList',
                            component: '/other/RoleList',
                            title: '角色列表',
                        },
                        {
                            path: '/other/list/system-role',
                            name: 'SystemRole',
                            component: '/role/RoleList',
                            title: '角色列表2',
                        },
                        {
                            path: '/other/list/permission-list',
                            name: 'PermissionList',
                            component: '/other/PermissionList',
                            title: '权限列表',
                        }
                    ]
                }
            ]
        }
    ]
}